package com.shihb.chapter07designpattern.decotator

/**
 * Description:
 * Version:1.0.0
 *
 * @author shihb
 * @date 2020/10/4 11:17
 */
object Cafe {
  def main(args: Array[String]): Unit = {
    println("--------订单一--------")
    var drink: Drink = Espresso()
    drink=new Milk(drink)
    drink.description
    println("合计:"+drink.cost)
    println("--------订单二--------")
    var drink2: Drink = Decaf()
    drink2=new Soy(drink2)
    drink2=new Soy(drink2)
    drink2=new Milk(drink2)
    drink2.description
    println("合计:"+drink2.cost)

  }

}

case class Espresso() extends Coffer("意大利咖啡",38.00)
case class Decaf() extends Coffer("无因咖啡",35.00)
